{extend name="layout" /}
{block name="link"}
<style>
    .child{
        margin-left: 30px;
    }
    .child2{
        margin-left: 30px;
    }
</style>
{/block}
{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-10">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{$meta_title}</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" name="post-form" id="commentForm" method="post" action="">
                    	<input type="hidden" name="id" value="{$info.id}">
                    	<div class="form-group">
                            <label class="col-sm-3 control-label">父级：</label>
                            <div class="col-sm-8">
                                <select name="pid" class="form-control" required="" aria-required="true">
                                	{volist name="role_list" id="vo"}
                                	<option {eq name="$info.pid" value="$key"}selected{/eq} value="{$key}">{$vo}</option>
                                	{/volist}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">名称：</label>
                            <div class="col-sm-8">
                                <input  name="title" minlength="2" type="text" class="form-control" required="" aria-required="true" value="{$info.title|default=''}">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 名称不能为空</span>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注：</label>
                            <div class="col-sm-8">
                                <textarea name="description" class="form-control" >{$info.description}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                    		<label class="col-sm-3 control-label">状态：</label>
                    		<div class="col-sm-8">
                    			<div class="radio i-checks">
                                    <label><input type="radio" {if $info.status eq 1}checked{/if} value="1" name="status"> <i></i> 显示</label>
                                    <label><input type="radio" {if $info.status eq 0}checked{/if}  value="0" name="status"> <i></i> 隐藏</label>
                                </div>
                            </div>
                    	</div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">权限：</label>
                            <div class="col-sm-8">
                                {notempty name="menus"}
                                {volist name="menus" id="menu"}
                                <div class="checkbox i-checks block">
                                    <label><input type="checkbox" name="menu_auth[]" value="{$menu.id}" class="js-check-all-node" {in name="$menu['id']" value="$info['menu_auth']"}checked{/in}> <i></i> {$menu.title}</label>
                                    {notempty name="menu.child"}
                                    {volist name="menu.child" id="submenu"}
                                    <div class="child">
                                        <div class="checkbox i-checks">
                                            <label><input type="checkbox" name="menu_auth[]" data-parent-id="{$menu['id']}" value="{$submenu.id}" class="js-check-all-group" {in name="$submenu['id']" value="$info['menu_auth']"}checked{/in}> <i></i> {$submenu.title}</label>
                                            {notempty name="submenu.child"}
                                            <div class="child2">
                                                <div class="checkbox i-checks">
                                                    {php}foreach ($submenu['child'] as $submenu2):{/php}
                                                    <label><input type="checkbox" name="menu_auth[]" data-parent-id="{$submenu['id']}" value="{$submenu2.id}" class="js-check-all-row" {in name="$submenu2['id']" value="$info['menu_auth']"}checked{/in}> <i></i> {$submenu2.title}</label>
                                                    {php}endforeach;{/php}
                                                </div>
                                            </div>
                                            {/notempty}
                                        </div>
                                    </div>
                                    {/volist}
                                    {/notempty}
                                </div>
                                {/volist}
                                {/notempty}
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary btn-post" target-form="post-form" type="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
